
                <script type="text/javascript">
                    var del_url = "{$this->url('attachment', 'del')}&id=";
                    var default_url = "{$this->url('attachment', 'upAttach')}&model={$c}&id=";
                </script>
                <script src="{$this->setting['weburl']}/content/js/upload.js?v={echo time()}" type="text/javascript"></script>
                <!--{if $result['attachments']}-->
                <script src="{$this->setting['weburl']}/content/js/attach.js?v={echo time()}" type="text/javascript"></script>
                <tr>
                    <th>已上传附件</th>
                    <th>注意：缩略图只能设置一张,设置多张缩略图只有最新上传的有效</th>
                </tr>

                <tr>
                    <td class="td2" colspan="2">
                        <div class="attachs">
                            {eval $attachments = $this->getAttachment( $result['id'], $c )}
                            <!--{loop $attachments $v}-->

                            <div class="attach">
                                <li class="attach-id" style="display: none;">{$v['id']}</li>
                                <li class="attach-img" style="display: none;">{$v['isImage']}</li>
                                <li class="attach-file" style="display: none;">{$v['filepath']}</li>
                                <li class="attach-name">{$v['filename']}</li>
                                <li class="attach-time">{echo formatDate($v['dateline'])}</li>
                                <li class="attach-size">{$v['filesize']}</li>
                                <!--{if $v['isImage']}-->
                                <li class="attach-default" isDefault="{$v['isDefault']}" title="{echo $v['isDefault'] ? '取消缩略图' : '设置为缩略图'}">
                                    {echo $v['isDefault'] ? '<b style="color: blue;">取消缩略图</b>' : '设置为缩略图'}</li>
                                <!--{else}-->
                                <li class="attach-default1"></li>
                                <!--{/if}-->
                                <li class="attach-del" title="删除附件">删除</li>
                                <li class="attach-insert" style="border-right: none; display: none;" title="添加附件到文章内容中">添加</li>
                            </div>
                            <!--{/loop}-->

                        </div>
                    </td>
                </tr>
                <!--{/if}-->
                <tr>
                    <td class="td1">商品图片</td>
                    <td class="td2">
                        <input type="file" name="upload" id="upload"/>
                        <script type="text/javascript">
                            var hash = "{echo md6( WEBCOOKIE, 'encode' )}";
                            var obj = $( "#upload" );
                            var model = "{$c}";
                            $( function () {
                                $( "#upload" ).uploadify( {
                                    'fileSizeLimit':"{$this->getSize()}",
                                    'fileTypeExts':"{$this->getType()}",
                                    'formData':{ "uphash":hash, "model":model },
                                    'swf':host + '/content/js/uploadify/uploadify.swf',
                                    'uploader':"{$this->url('attachment', 'up')}",
                                    'onUploadSuccess':function ( file, data, response ) {
                                        var obj = eval( '(' + data + ')' );
                                        var attach = $( 'input[name="attach[id]"]' );
                                        var val = $.trim( attach.val() );
                                        attach.val( obj.id + "," + val );
                                    }
                                } );
                            } );
                        </script>
                        <div class="upinfo">可用扩展名: {$this->getType()} 文件大小: {$this->getSize()}</div>
                    </td>
                </tr>
